<!-- 废弃【先学后付没有了】 -->
<template>
	<view>
		<page-head :title="'我的学车'" :headtype="2"></page-head>
		<block v-for="(item,index) in datas" :key="index">
			<view class="cardeach marginAuto">
				<image class="cardeachbg" :src="apifun.serveimg+'mystudybg.png'" mode=""></image>
				<view class="cardeachq mainBg baiColor" v-if="item.pay_type == 2">先学后付</view>
				<view class="cardeachmain">
					<view class="cardeachname">{{ item.school_name }}</view>
					<view class="cardeachb flex">
						<view class="cardeachbimg">
							<image :src="apifun.URLimg+item.school_img" mode=""></image>
						</view>
						<view class="cardeachbmsg">
							<view class="cardeachbmsg-name ellipsis01">{{ item.course_name }}</view>
							<view class="cardeachbmsg-jl flex">
								<!-- <uv-icon name="map" color="#1686F8" size="16"></uv-icon> -->
								<!-- <view class="jl-num mainColor" style="margin:0 10rpx;">0.5km</view> -->
								<view class="jl-txt" style="color:#666666;">郑州市 金水区</view>
							</view>
							<view class="cardeachbmsg-money">
								<text style="font-size: 20rpx;color:#FC2A2A;">￥</text>
								<text style="font-size:36rpx;color:#FC2A2A;">{{ item.price }}</text>
								<text style="font-size:24rpx;color:#666666;margin-left:20rpx;">￥{{ item.old_price }}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="subjecton marginAuto" style="margin-top: 20rpx;">{{ item.status_txt }}</view>
			<!-- <view class="subjecton marginAuto" style="margin-top: 20rpx;" v-if="item.pay_status != 4">学习中...</view>
			<view class="subjecton marginAuto" style="margin-top: 20rpx;" v-if="item.pay_status == 4">已结束</view> -->
			
			<block v-if="item.score1 > 0">
				<view class="subjectname marginAuto">科目1</view>
				<view class="subjectend marginAuto">
					<view class="subjectendt flex">
						<view class="subjectendt-cj">
							<text style="color: #333333;font-size: 32rpx;">成绩 {{ item.score1 }}分</text>
							<!-- <text style="color:#1686F8; font-size: 24rpx;margin-left: 18rpx;">成绩单></text> -->
						</view>
						<!-- <view class="subjectendt-moeny">需支付￥6500</view> -->
					</view>
					<view class="subjectendb flex">
						<view class="subjectendbtime">更新时间：{{ item.score1_time }}</view>
						<!-- <view class="subjectendbbtn mainBg baiColor" v-if="item.pay_type == 2">支付</view> -->
						<view class="subjectendbbtn" style="color:#149E22;" v-if="item.pay_type != 2">已支付</view>
					</view>
				</view>
			</block>
			<block v-if="item.score2 > 0">
				<view class="subjectname marginAuto">科目2</view>
				<view class="subjectend marginAuto">
					<view class="subjectendt flex">
						<view class="subjectendt-cj">
							<text style="color: #333333;font-size: 32rpx;">成绩 {{ item.score2 }}分</text>
							<!-- <text style="color:#1686F8; font-size: 24rpx;margin-left: 18rpx;">成绩单></text> -->
						</view>
						<!-- <view class="subjectendt-moeny">需支付￥6500</view> -->
					</view>
					<view class="subjectendb flex">
						<view class="subjectendbtime">更新时间：{{ item.score2_time }}</view>
						<!-- <view class="subjectendbbtn mainBg baiColor" v-if="item.pay_type == 2">支付</view> -->
						<view class="subjectendbbtn" style="color:#149E22;" v-if="item.pay_type != 2">已支付</view>
					</view>
				</view>
			</block>
			<block v-if="item.score3 > 0">
				<view class="subjectname marginAuto">科目3</view>
				<view class="subjectend marginAuto">
					<view class="subjectendt flex">
						<view class="subjectendt-cj">
							<text style="color: #333333;font-size: 32rpx;">成绩 {{ item.score3 }}分</text>
							<!-- <text style="color:#1686F8; font-size: 24rpx;margin-left: 18rpx;">成绩单></text> -->
						</view>
						<!-- <view class="subjectendt-moeny">需支付￥6500</view> -->
					</view>
					<view class="subjectendb flex">
						<view class="subjectendbtime">更新时间：{{ item.score3_time }}</view>
						<!-- <view class="subjectendbbtn mainBg baiColor" v-if="item.pay_type == 2">支付</view> -->
						<view class="subjectendbbtn" style="color:#149E22;" v-if="item.pay_type != 2">已支付</view>
					</view>
				</view>
			</block>
			<block v-if="item.score4 > 0">
				<view class="subjectname marginAuto">科目4</view>
				<view class="subjectend marginAuto">
					<view class="subjectendt flex">
						<view class="subjectendt-cj">
							<text style="color: #333333;font-size: 32rpx;">成绩 {{ item.score4 }}分</text>
							<!-- <text style="color:#1686F8; font-size: 24rpx;margin-left: 18rpx;">成绩单></text> -->
						</view>
						<!-- <view class="subjectendt-moeny">需支付￥6500</view> -->
					</view>
					<view class="subjectendb flex">
						<view class="subjectendbtime">更新时间：{{ item.score4_time }}</view>
						<!-- <view class="subjectendbbtn mainBg baiColor" v-if="item.pay_type == 2">支付</view> -->
						<view class="subjectendbbtn" style="color:#149E22;" v-if="item.pay_type != 2">已支付</view>
					</view>
				</view>
			</block>
		</block>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				apifun:this.apifun,
				datas:[]
			};
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData(){
				this.apifun.unirequest('/api/study/getMyStudyOrder','post',{},(res)=>{
					// console.log(res)
					if(res.code === 200){
						let datas = res.data;
						this.datas = datas;
					}else{
						this.apifun.toast(res.msg)
					}
				})
			}
		},
	};
</script>

<style scoped lang="scss">
	page{
		background: #F7F7F7;
	}
	.cardeach{
		position: relative;
		padding: 30rpx;
		width: 630rpx;
		background: #fff;
		margin-top: 20rpx;
		border-radius:20px;
		.cardeachbg{
			position:absolute;
			top: 0;
			left: 0;
			width:100%;
			height: 100%;
			z-index: 0;
			border-radius:20px;
		}
		.cardeachq{
			position: absolute;
			top:0rpx;
			right:0rpx;
			padding:0 10rpx;
			line-height:50rpx;
			font-size:20rpx; 
			border-top-right-radius: 20rpx;
			border-bottom-left-radius: 20rpx;
		}
		.cardeachmain{
			position: relative;
			z-index: 10;
			.cardeachname{
				color: #222222;
				font-size: 32rpx;
				line-height: 60rpx;
				font-weight: 600;
			}
			.cardeachb{
				margin-top: 20rpx;
				.cardeachbimg{
					width: 180rpx;
					height: 200rpx;
					image{
						width: 180rpx;
						height: 200rpx;
						border-radius:10rpx;
					}
				}
				.cardeachbmsg{
					margin-left: 20rpx;
					.cardeachbmsg-name{
						color: #333333;
						font-size: 28rpx;
						margin-top:20rpx;
					}
					.cardeachbmsg-jl{
						padding: 14rpx 0;
						font-size: 24rpx;
						line-height:40rpx;
					}
					.cardeachbmsg-money{
						line-height: 50rpx;
					}
				}
			}
		}
	}
	.subjectname{
		width: 690rpx;
		padding: 20rpx 0;
		line-height: 50rpx;
		font-weight: 600; 
	}
	.subjecton{
		width: 630rpx;
		padding: 28rpx 30rpx;
		background: #fff;
		border-radius: 20rpx;
		font-size: 32rpx;
		color: #333333;
	}
	.subjectend{
		width: 630rpx;
		background: #fff;
		border-radius: 20rpx;
		padding: 30rpx;
		.subjectendt{
			justify-content: space-between;
			line-height: 50rpx;
			.subjectendt-cj{}
			.subjectendt-moeny{
				color: #FC2A2A;
				font-size: 24rpx;
			}
		}
		.subjectendb{
			justify-content: space-between;
			margin-top: 20rpx;
			.subjectendbtime{
				font-size: 24rpx;
				color: #666666;
			}
			.subjectendbbtn{
				width: 130rpx;
				height: 60rpx;
				line-height: 60rpx;
				text-align: center;
				border-radius: 100rpx;
			}
		}
	}
</style>